import http from '../http'

// 分页查询入库明细
export function pageInboundDetails(data) {
  return http.post('/warehousing/warehouse/receipt-detail/page', data)
}

// 获取入库明细详情
export function getInboundDetail(id) {
  return http.get(`/warehousing/warehouse/receipt-detail/${id}`)
}

// 新增入库明细
export function addInboundDetail(data) {
  return http.post('/warehousing/inbound-details', data)
}

// 修改入库明细
export function updateInboundDetail(id, data) {
  return http.put(`/warehousing/inbound-details/${id}`, data)
}

// 删除入库明细
export function deleteInboundDetail(ids) {
  return http.delete('/warehousing/inbound-details', { data: { ids } })
}

// 获取入库单明细列表
export function getReceiptDetailList(receiptId) {
  return http.get(`/warehouse/receipt/${receiptId}/details`)
}

// 添加入库单明细
export function addReceiptDetail(receiptId, data) {
  return http.post(`/warehouse/receipt/${receiptId}/details`, data)
}

// 修改入库单明细
export function updateReceiptDetail(receiptId, detailId, data) {
  return http.put(`/warehouse/receipt/${receiptId}/details/${detailId}`, data)
}

// 删除入库单明细
export function deleteReceiptDetail(receiptId, detailIds) {
  return http.delete(`/warehouse/receipt/${receiptId}/details/${detailIds}`)
}
